package com.ethank.enums.ali;

import com.ethank.entity.VoucherResponseVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tf
 * @date 2024-03-25
 * @Description
 */
public enum InvoiceItemEnum {
    ITEMNAME("itemName", "货物或应税劳务、服务名称", "", 1, false),
    SPECIFICATION("specification", "规格型号", "", 1, false),
    UNIT("unit", "单位", "", 1, false),
    QUANTITY("quantity", "数量", "", 1, false),
    UNITPRICE("unitPrice", "单价", "", 1, false),
    AMOUNT("amount", "金额", "", 1, false),
    TAXRATE("taxRate", "税率", "", 1, false),
    TAX("tax", "税额", "", 1, false);
    private  String key;
    private  String label;
    private  String value;
    private  Integer type;
    private  boolean require;

    InvoiceItemEnum(String key, String label, String value, Integer type, boolean require) {
        this.key = key;
        this.label = label;
        this.value = value;
        this.type = type;
        this.require = require;
    }

    InvoiceItemEnum() {
    }
    public static List<VoucherResponseVO> convertVoucher() {
        ArrayList<VoucherResponseVO> vos = new ArrayList<>();
        for (InvoiceItemEnum fieldEnum : InvoiceItemEnum.values()) {
            VoucherResponseVO vo = new VoucherResponseVO();
            vo.setKey(fieldEnum.getKey());
            vo.setLabel(fieldEnum.getLabel());
            vo.setType(fieldEnum.getType());
            vos.add(vo);
        }
        return vos;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public boolean isRequire() {
        return require;
    }

    public void setRequire(boolean require) {
        this.require = require;
    }
}
